Skip to content

enh/806-add-gossipsub-1.2-support #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Winter-Soren
Copy link
Contributor

What was wrong?

Issue #806

py-libp2p was missing support for GossipSub 1.2, which includes important security and performance improvements over GossipSub 1.1. The missing features included:

  • [] Peer scoring system for spam prevention and mesh quality improvement
  • IDONTWANT control messages for efficient bandwidth usage
  • [] IP colocation detection to mitigate Sybil attacks
  • [] Enhanced security parameters and configuration options

Without these features, py-libp2p networks were vulnerable to spam attacks and had suboptimal mesh quality compared to other libp2p implementations.

How was it fixed?

Implemented complete GossipSub 1.2 support following the official specification and maintaining compatibility with go-libp2p and js-libp2p implementations.

Key Components Added:

  1. Enhanced Control Messages:

    • Updated protobuf definitions with IDONTWANT message type
    • Handler implementation for efficient message exchange optimization
    • Backward-compatible protocol negotiation
  2. Core Integration:

    • Added GossipSub 1.2 protocol ID (/meshsub/1.2.0)
    • Integrated scoring with mesh management and peer selection
    • Optional enabling for backward compatibility

To-Do

  • [] Implement Peer scoring system
  • Message author validation
  • IP colocation checks
  • Spam protection enhancements
  • Extended control messages
  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

Gossipping Meerkats

@seetadev
Copy link
Contributor

@Winter-Soren : Great, thank you for submitting the PR. Reviewing the PR and getting it ready for production level testing.

As discussed, reiterating the pointers shared: according to the Gossipsub 1.2 spec, the primary addition at that version is indeed the IDONTWANT control message. The extra features you mentioned—message author validation, IP colocation checks, spam protection enhancements, and extended control messages- are not part of the 1.2 scope. Those were proposed, refined in later iterations (1.3 and 1.4), where the focus broadened to include stronger validation, Sybil resistance measures, anti-spam controls.

So your understanding is correct: in 1.2, we only need to ensure we’re compliant with the IDONTWANT mechanism, keeping the implementation lean and true to the spec. The additional enhancements you mentioned are indeed tracked for later Gossipsub versions, and we can plan to incorporate them once we’re ready to move toward 1.4 compatibility.

CCing @lla-dane , who is working on peer store integration with Gossipsub. Would recommend him to do integration for Gossipsub 1.2 branch too.

@seetadev
Copy link
Contributor

@Winter-Soren : Hi Soham. Please resolve the merge conflicts. Will re-run the CI/CD pipeline once they are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants